package example.guice.web.rest

import javax.ws.rs.Path
import javax.ws.rs.GET
import javax.inject.Provider
import javax.inject.Inject
import example.guice.web.servlets.RequestPojo
import dba.example.guice.dao.CompanyDao
import javax.ws.rs.Produces
import javax.ws.rs.core.MediaType._
import javax.ws.rs.QueryParam

@Path("/company")
class CompanyResource @Inject() (val companyDao: CompanyDao) {
  
  @GET
  @Path("/list")
  @Produces(Array(APPLICATION_JSON))
  def list() = companyDao.findAll

  @GET
  @Path("/get")
  @Produces(Array(APPLICATION_JSON))
  def get(@QueryParam("id") id: Integer) = companyDao.get(id)
  
}